Skip to main content

Mark Read Notification

The markReadNotification() function is used to mark a notification as read. It takes a MarkReadNotificationRequest as input and returns a MarkReadNotificationResponse as a Future.

Steps to Mark a Notification as Read​

  1. Build a MarkReadNotificationRequest object using the MarkReadNotificationRequestBuilder class.

  2. Call the markReadNotification() function using the instance of the LMFeedClient class.

  3. Use the response as per your requirement.

     // Build the request object
    MarkReadNotificationRequest markReadNotificationRequest = (MarkReadNotificationRequestBuilder()
    ..activityId("your_activity_id_here"))
    .build();

    // Get the response from calling the function
    final MarkReadNotificationResponse markReadNotificationResponse = await lmFeedClient.markReadNotification(markReadNotificationRequest);

    // Process the response, as per requirement
    if(markReadNotificationResponse.success){
    // your function to handle successful marking of notification as read
    handleMarkReadNotificationSuccess();
    }else{
    // your function to handle error message
    handleMarkReadNotificationError(markReadNotificationResponse.errorMessage);
    }

Models​

MarkReadNotificationRequest​

List of parameters for the MarkReadNotificationRequest class

VariableTypeDescriptionOptional
activityIdStringID of the notification activity to mark as read

MarkReadNotificationResponse​

List of parameters for the MarkReadNotificationResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageStringError message in case of failure✔